package com.wandian.core
{
	import flash.events.EventDispatcher;
	import flash.utils.Dictionary;
	
	import com.wandian.core.GameXmlManager;
	import com.wandian.core.xmlCore.XmlListLibrary;
	

	public class GameXmlManager extends EventDispatcher
	{
		public function GameXmlManager()
		{
		}
		private static var _instance:GameXmlManager;
		
		public static function get instance():GameXmlManager
		{
			return _instance||=new GameXmlManager
		}
		
		private var _xmlListLibrary:XmlListLibrary=new XmlListLibrary
		private var _xmlDic:Dictionary=new Dictionary;
			
			
		public function start():void{
			
		}
		public function intoXml(xml:XML):void{
			_xmlListLibrary.setUIStyle(getXmlList(xml));
			_xmlDic[xml.@name]=xml;
		}
		
		private function getXmlList(xml:XML):XMLList{
			return xml..view
		}
		public function getUIStyleXml(str:String):XML{
			return _xmlListLibrary.getStyleDic[str];
		}
		public function getXmlByName(str:String):XML{
			return _xmlDic[str];
		}
		public function end():void{
			
		}
		
	}
}